#ifndef TASK_H
#define TASK_H

#include <system.h>

#define SYSTEM_TASK		0

typedef struct task
{
	uint32_t pid;		/* Process ID */
	uint32_t stack;		/* Task's stack */
	uint32_t state : 1;	/* Is task running? */
	uint32_t vm86 : 1;
	uint32_t stopped;	/* Is task stopped? */
	uint32_t spins;		/* Number of cycles */
	uint8_t name[32];	/* Task's name */
	uint32_t esp;		/* Original stack location */
	void (*thread)();	/* Actual thread entry */
}task_t;


extern task_t *tasks;
extern uint32_t curr_pid;
extern uint32_t pidcount;
extern uint32_t taskcount;

#endif


